package com.feri.findlife.controller;

import com.feri.findlife.dto.PageDto;
import com.feri.findlife.pojo.Circle;
import com.feri.findlife.service.intf.CircleService;
import com.feri.findlife.vo.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @program: FindLife
 * @description:
 * @author: Feri(邢朋辉)
 * @create: 2020-12-21 15:11
 */
//@Controller
@RestController
@RequestMapping("/api/circle/")
public class CircleController {
    @Autowired
    private CircleService service;
    // ThreadLocal tl;
    //新增圈子
    @PostMapping("save.do")
    public R save(@RequestBody Circle circle){
        return service.save(circle);
    }
    //查询圈子列表
    @GetMapping("all.do")
    public R all(){
        return service.all();
    }
    //查询圈子 包含分页 查询条件：圈子名称
    @GetMapping("queryall.do")
    public R all(@RequestBody PageDto dto){
        return service.selectByPage(dto);
    }

    //热门圈子
    @GetMapping("allTop.do")
    public R allTop(){
        return service.allTop();
    }
}
